#!/bin/bash

# git clone https://github.com/OpenCAEPlus/OpenCAEPoro_ASC2024.git OpenCAEPoro_ASC2024
[ -e OpenCAEPoro_ASC2024 ] || git clone https://git.royenheart.com/royenheart/OpenCAEPoro_ASC2024.git OpenCAEPoro_ASC2024
cd OpenCAEPoro_ASC2024
ls *.tar.gz | grep -Ev "(OpenCAEPoro\.*)|(petsc_solver\.*)" | xargs -I {} tar -xf {} -C ..

# hypre git
git clone https://git.royenheart.com/royenheart/hypre.git hypre-git

# hypre 2.30.0
wget -c https://github.com/hypre-space/hypre/archive/refs/tags/v2.30.0.tar.gz
tar -xf v2.30.0.tar.gz -C .
rm v2.30.0.tar.gz

# hypre 2.29.0
wget -c https://github.com/hypre-space/hypre/archive/refs/tags/v2.29.0.tar.gz
tar -xf v2.29.0.tar.gz -C .
rm v2.29.0.tar.gz

# petsc 3.20.2
wget -c https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.20.2.tar.gz
tar -xf petsc-3.20.2.tar.gz -C .
rm petsc-3.20.2.tar.gz

# kokkos 4.2.0
wget -c https://github.com/kokkos/kokkos/archive/refs/tags/4.2.00.tar.gz
tar -xf kokkos-4.2.00.tar.gz -C .
rm kokkos-4.2.00.tar.gz

# jemalloc
wget -c https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2
tar -xf jemalloc-5.3.0.tar.bz2 -C .
rm jemalloc-5.3.0.tar.bz2

# SuperLU_DIST
wget -c https://github.com/xiaoyeli/superlu_dist/archive/refs/tags/v8.2.1.tar.gz
tar -xf superlu_dist-8.2.1.tar.gz -C .
rm superlu_dist-8.2.1.tar.gz
